<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./js/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- <h2>{{title}}</h2> -->
        <button-counter num="12" title="props传参"></button-counter>
        <button-counter num="2116" title="嘿嘿嘿"></button-counter>
    </div>

</body>
<script>

    // //vue组件
    Vue.component('button-counter', {
        props: ['title', 'num'],
        data() {
            return {
                count: 0,
            }
        },
        template: ' <h3>{{title}}<button @click="num++">点击我改变数值{{num}}</button></h3>'
    })
    const vm = new Vue({
        el: "#app",
        data: {
            title: "Vue组件了哦!"
        },
        mounted() {
            document.querySelector("title").innerHTML = this.title
        }
    })


</script>

</html>